<table cellpadding="0" cellspacing="1" width="100%" bgcolor="#D3E1F1">
    <tr>
        <td width="80%" class="rongbay-form-title">
            <h1><a href="manage_hotel.html">QUẢN LÝ GIAN HÀNG</a> {if $can_add}[ <a href="manage_booth.html?cmd=add&amp;href={$href}">Thêm mới</a> ]{/if} </h1>
        </td>
        <td width="6%" class="form_title_button"></td>
    </tr>
</table>

{if $is_admin}
    <table width="100%" cellspacing="0" cellpadding="5" border="1" bgcolor="#D3E1F1" style="border-collapse:collapse" bordercolor="#999999">
        <tr>
            <td width="12%" align="right"><strong>Trạng thái:</strong></td>
            <td colspan="5">
                <div style="float:left; width:70px">
                    <input {if $hotel_status=='0'}checked="checked"{/if} type="radio" value="0"
                                                  name="hotel_status" id="block">
                    <label style="cursor:pointer" for="block">Tất cả</label>
                </div>
                <div style="float:left; width:120px">
                    <input {if $hotel_status=='1'}checked="checked"{/if} type="radio" value="1"
                                                  name="hotel_status" id="block1">
                    <label style="cursor:pointer" for="block1">Đang sử dụng</label>
                </div>
                <div style="float:left; width:80px">
                    <input {if $hotel_status=='2'}checked="checked"{/if} type="radio" value="2"
                                                  name="hotel_status" id="block2">
                    <label style="cursor:pointer" for="block2">Đang ẩn</label>
                </div>
            </td>
        </tr>
        <tr>
            <td align="right"><strong>ID:</strong></td>
            <td align="left" width="285px"><input type="text" id="hotel_id" name="hotel_id" value="{$hotel_id}" style="width:200px"/></td>
            <td align="right"><strong>Mô tả:</strong></td>
            <td align="left"><input type="text" id="hotel_desc" name="hotel_desc" value="{$hotel_desc}" style="width:200px"/></td>
            <td align="right" nowrap="nowrap"><strong>Tên Nhà hàng:</strong></td>
            <td align="left" nowrap="nowrap"><input type="text" id="hotel_name" name="hotel_name" value="{$hotel_name}" style="width:200px"/></td>

        </tr>
        <tr>
            <td align="right">&nbsp;</td>
            <td colspan="5" align="left"><input type="submit" value="Tìm kiếm"/></td>
        </tr>
    </table>
{/if}

<div align="center">
    {$message}
</div>

<p style="float:right">{$paging}</p>

<table width="99%" bordercolor="#CCCCCC" border="1" cellspacing="0" cellpadding="2" style="border-collapse:collapse;margin: 20px auto">
    {if $hotels}
        {if $can_delete || $can_add}
            <tr>
                <td colspan="15" align="right" class="p10">
                    <div class="fl">{if ($can_delete)}
                        [ <a href="javascript:void(0);" onclick="selectAllCheckbox(document.ManageHotelForm, 'ManageHotelForm', true, '#FFFFEC', 'white');">Chọn tất cả</a> ]
                        [ <a href="javascript:void(0);" onclick="selectAllCheckbox(document.ManageHotelForm, 'ManageHotelForm', false, '#FFFFEC', 'white');">Bỏ chọn</a> ]
                        [ <a href="javascript:void(0);" onclick="selectAllCheckbox(document.ManageHotelForm, 'ManageHotelForm', -1, '#FFFFEC', 'white');">Chọn ngược lại</a> ]
                    {/if}</div>
                <div class="c"></div>
            </td>
        </tr>
    {/if}
    <tr bgcolor="#EFEFEF">
        {if $can_delete}
            <th width="2%" title="check_all"><input type="checkbox" value="1" id="ManageHotelForm_all_checkbox" onclick="selectAllCheckbox(this.form, 'ManageHotelForm', this.checked, '#FFFFEC', 'white');" /></th>
            {/if}

        <th width="3%">Id</th>
        <th width="5%">Icon</th>
        <th width="10%">Ảnh mô tả</th>
        <th width="10%">Name</th>
        <th width="20%">Mô tả</th>
        <th width="5%">Status</th>
        <th width="5%">Sửa</th>

        <th width="10%">QL thực đơn</th>
    </tr>

    {foreach from=$hotels key=k item=hotel}
        <tr {if !($k%2)}bgcolor="#f0f0f0"{/if} id="sys_tr_hote_id_{$hotel.id}">
            {if ($can_delete)}
                <td align="center"><input name="selected_ids" type="checkbox" value="{$hotel.id}" onclick="select_checkbox(this.form, 'ManageHotelForm', this, '#FFFFEC', 'white');" /></td>
                {/if}
            <td align="center">{$hotel.id}</td>
            <td><img src="{$hotel.icon}" alt="{$hotel.name}" width="50" height="auto"> </td>
            <td><img src="{$hotel.img}" alt="{$hotel.name}" width="50" height="auto"> </td>
            <td>{$hotel.name}</td>
            <td>{$hotel.desc}</td>
            <td nowrap="nowrap">
    {if $hotel.status==1}<font color="#0066FF">Hiện</font>{elseif $hotel.status==2}<font color="#FF6600">Đang ẩn</font>{elseif $hotel.status==-1}<font color="#FF0000">Đã xóa</font>{/if}<br />

    {if $hotel.status==1}
        {if $hotel.can_edit}
            [<a href="manage_booth.html?cmd=hide&id={$hotel.id}&href={$href}">Ẩn</a>]
        {/if}
    {elseif $hotel.status==2}
        {if $hotel.can_edit}
            [<a href="manage_booth.html?cmd=show&id={$hotel.id}&href={$href}">Hiện</a>]
        {/if}
    {elseif $hotel.status==-1 && $can_edit}
        [<a href="manage_booth.html?cmd=restore&id={$hotel.id}&href={$href}">Khôi phục</a>]
    {/if}
</td>
{if $can_delete || $admin_some_hotel}
    <td nowrap="nowrap">
    [ <a href="manage_booth.html?cmd=edit&id={$hotel.id}&href={$href}">Sửa</a> ]
</td>
{/if}
<td align="center" nowrap="nowrap">
{if $hotel.can_edit}<a href="manage_booth_menu.html?booth_id={$hotel.id}">QL thực đơn </a><span style="color: red;font-size: 10px;">({$hotel.total_menu_booth} thực đơn)</span>{/if}<br/>
</td>

</tr>
{/foreach}
{else}
    <tr>
        <td colspan="15" align="right" class="p10">
            <strong>Không tìm thấy nhà hàng nào!</strong>
        </td>
    </tr>
    {/if}
    </table>

    <p style="float:right">{$paging}</p>